****************************************************************************
* File-Nale: 		experiment codes.do
* Date:		 07/22/2020
* Author: 		Fred Batista
* Purpose: 		Analysis of Facebook Experiment (2014)
* Data used: 		experiment.dta
* Data Output:	None	*/
****************************************************************************

* generating variable of sexism

gen sexism = (womenexp + menbetterleaders + 1)/2

* generating variable of conditions (1 �no T no primed� , 2 �no T primed� , 3 �T np primed�, 4 �T primed�)

egen conditions = group(treatment primed)


*** BALANCE CHECKS

mprobit conditions male education age i.region i.race c.death##c.petro, base(1)


*** WAS SEXISM MEASURE AFFECTED BY QUESTION ORDER MANIPULATION?

reg womenexp i.primed##i.treatment

reg menbetterleaders i.primed##i.treatment

reg sexism i.primed##i.treatment


*** NON PRIMED

* ATE

probit femvote i.treatment if primed==0

margins treatment

marginsplot, plot1(mcolor(black) connect(none)) ci1(lcolor(black) msize(vtiny)) ytitle("") xtitle("Experimental Condition", size(large) margin(medsmall)) xlabel(-.5 " " 0 "4 Candidates" 1 "12 Candidates" 1.5 " ", noticks labsize(medium)) ylabel(.10 ".10" .20 ".20" .30 ".30" .40 ".40",nogrid) title("Predicted Probability of Vote" "for Female Candidate", color(black) size(large)) yscale(noextend)  plotregion(style(none)  margin(medlarge)) graphregion(color(white)  margin(medlarge)) ysize(8) xsize(8) saving(noprime1)

* HTE

probit femvote i.treatment##c.sexism if primed ==0

margins, dydx(treatment) at(sexism=(1(1)7))

marginsplot, plot1(mcolor(black) connect(black) lcolor(black)) ci1(lcolor(black) msize(vtiny)) ytitle("") xtitle("Explicit Sexism", size(large) margin(medsmall)) xlabel(1 "Lowest" 2 " " 3 " " 4 " " 5 " " 6 " " 7 "Highest", labsize(medium)) ylabel(-.6 "-.60" -.4 "-.40" -.2 "-.20" 0 ".00" .2 ".20" .4 ".40" .6 ".60",nogrid) title("Heterogeneous Treatment" "Effects", color(black) size(large)) yline(0, lcolor(black) lpattern(dash)) yscale(noextend)  plotregion(style(none) margin(medlarge)) graphregion(color(white) margin(medlarge)) ysize(8) xsize(8) saving(noprime2)

graph combine noprime1.gph noprime2.gph, title(Unprimed Subjects (n=299), color(black) size(vlarge) pos(6)) ysize(6) xsize(10) iscale(1) graphregion(color(white) margin(medium)) saving(expcomb)


*** PRIMED

* ATE

probit femvote i.treatment if primed==1

margins treatment

marginsplot, plot1(mcolor(black) connect(none)) ci1(lcolor(black) msize(vtiny)) ytitle("") xtitle("Experimental Condition", size(large) margin(medsmall)) xlabel(-.5 " " 0 "4 Candidates" 1 "12 Candidates" 1.5 " ", noticks labsize(medium)) ylabel(.10 ".10" .20 ".20" .30 ".30" .40 ".40",nogrid) title("Predicted Probability of Vote" "for Female Candidate", color(black) size(large)) yscale(noextend)  plotregion(style(none)  margin(medlarge)) graphregion(color(white)  margin(medlarge)) ysize(8) xsize(8) saving(expmainp)


* HTE

probit femvote i.treatment##c.sexism if primed ==1

margins, dydx(treatment) at(sexism=(1(1)7))

marginsplot, plot1(mcolor(black) connect(black) lcolor(black)) ci1(lcolor(black) msize(vtiny)) ytitle("") xtitle("Explicit Sexism", size(large) margin(medsmall)) xlabel(1 "Lowest" 2 " " 3 " " 4 " " 5 " " 6 " " 7 "Highest", labsize(medium)) ylabel(-.6 "-.60" -.4 "-.40" -.2 "-.20" 0 ".00" .2 ".20" .4 ".40" .6 ".60",nogrid) title("Heterogeneous Treatment" "Effects", color(black) size(large)) yline(0, lcolor(black) lpattern(dash)) yscale(noextend)  plotregion(style(none) margin(medlarge)) graphregion(color(white) margin(medlarge)) ysize(8) xsize(8) saving(expmargp)

graph combine expmainp.gph expmargp.gph, title(Primed Subjects (n=291), color(black) size(vlarge) pos(6)) ysize(6) xsize(10) iscale(1) graphregion(color(white) margin(medium)) saving(primedcomb)


*** FULL DATA


* ATE

probit femvote i.treatment##i.primed 

* HTE

probit femvote i.treatment##c.sexism##i.primed 


* ROBUSTNESS CHECKS FOR NONPRIMED


** Cognitive overload

* cognitive overload evidence

oprobit understand i.treatment if primed==0

* controlling for cognitive overload
 
probit femvote i.treatment##c.sexism c.understand if primed==0


** Other moderators

* discrimination against blacks is no longer a problem

probit femvote i.treatment##c.sexism i.treatment##c.nodisc if primed==0

* blacks treated unfairly (inverted)

probit femvote i.treatment##c.sexism i.treatment##c.bunfair_inv if primed==0

* BF recipients spend money with wrong things

probit femvote i.treatment##c.sexism i.treatment##c.bfwrong if primed==0

* BF makes recipients lazy

probit femvote i.treatment##c.sexism i.treatment##c.bflazy if primed==0


** affinity effects

probit femvote i.treatment##c.sexism i.treatment##i.male if primed ==0

probit femvote i.treatment##c.sexism i.treatment##i.male if primed ==1



*** END OF CODE

